package com.example.shop_car_2208.mvvmdemo

import androidx.lifecycle.MutableLiveData
import androidx.lifecycle.ViewModel
import com.example.shop_car_2208.entity.ParamLogin
import com.example.shop_car_2208.entity.UserEntityResult
import com.example.shop_car_2208.mvvmdemo.LoginRepo

class LoginViewModel:ViewModel() {
    val loginSuccess = MutableLiveData<UserEntityResult>()
    val loginFail =  MutableLiveData<String>()
    val repo = LoginRepo()
    fun login(username:String,password:String){
        val param = ParamLogin(username,password)
        repo.login(param, loginSuccess,loginFail)

    }
}